package com.cm.controller;

import com.cm.domain.Person;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/validated")
public class PersonController {

    @PostMapping("/test")
    public Object test(@RequestBody @Validated Person person){
        return person;
    }

    @PostMapping("/test1")
    public Object test1(@RequestBody Person person){
        return person;
    }

}
